Skip to main content

Kubernetes Cluster via CLI

Accessing Kubernetes Cluster via CLI

Kubernetes CLI access allows you to interact with your cluster directly from the terminal using kubectl. This is useful for inspecting, managing, and troubleshooting resources running in your cloud environment via Stack Console.


Download Kubeconfig for the Cluster

The kubectl command-line tool uses kubeconfig files to find the information it needs to choose a cluster and communicate with the API server of a cluster.

Download kubectl Tool

Download the kubectl binary matching your cluster's Kubernetes version (v1.27.3):

Use kubectl With Your Kubeconfig File

You can now run kubectl commands using your downloaded kubeconfig file.

kubectl --kubeconfig /custom/path/kube.conf {COMMAND}
  • List Pods:
kubectl --kubeconfig /custom/path/kube.conf get pods --all-namespaces
  • List Nodes:
kubectl --kubeconfig /custom/path/kube.conf get nodes --all-namespaces
  • List Services:
kubectl --kubeconfig /custom/path/kube.conf get services --all-namespaces

Conclusion

By following this guide, you can set up and use the kubectl CLI to manage your Kubernetes clusters via the Stack Console. This method provides a powerful and flexible way to interact with cluster resources directly from your terminal.